/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Soligee.controller.bo;

import Soligee.model.vo.cadastros.UsuarioVO;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpSession;

/**
 *
 * @author Sem Nome
 */
public class ControleAcessoBO{
        
        
    public static HttpSession obterSessao(){
        HttpSession session = (HttpSession) 
        FacesContext.getCurrentInstance().getExternalContext().getSession(true);  
        return (session);
    }
    
    public static boolean verificaPermisao(UsuarioVO user, Class classe ){
        if(user.getNivel()==1){

            if(classe.getName().equals("Soligee.view.CadastrarPedido"))
                return true;
            else
                return false;

        }
        else
            return false;

    }

}
